//
// Created by 25137 on 2024/2/8.
//

#include "mserialportq.h"
#include <QThread>

MSerialPortQ::MSerialPortQ(QObject *parent) : MSerialPort(), QObject(parent) {
}


MPort::COM_STATUS MSerialPortQ::open(const QString& str, int baud) {
    return this->openCOM( [&](MIODeviceBase device) {
                       this->callback(device);
                   }
        ,str.toStdString(),baud);
}

void MSerialPortQ::callback(MIODeviceBase& device) {
    emit readyRead(device);
}
